home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1994 August / August CD.bin / Shareware / Programming / Infinity Windoid WDEF 2.6 / WindoidDefines.h < prev    next >
Text File  |  1994-04-05  |  9KB  |  230 lines

  1. // *****************************************************************************
  2. //
  3. //    WindoidDefines.h
  4. //
  5. // -----------------------------------------------------------------------------
  6. //    This file contains only the #define's used to determine how to compile
  7. //    the Infinity Windoid WDEF. By modifying only this file, you can choose
  8. //    what capabilities will be included when the WDEF is compiled.
  9. // *****************************************************************************
  10. #ifndef __WindoidDefines__
  11. #define __WindoidDefines__
  12.  
  13. // *****************************************************************************
  14. //    Conditional Compilation Options
  15. // -----------------------------------------------------------------------------
  16. /*
  17.  
  18. The #define's you may make include:
  19.  
  20.     ALLOW_VERT -    This determines if the code that is compiled will support
  21.                     a palette that has a vertical title bar along the left
  22.                     side of the window (rather than the top). To create such
  23.                     a window, add one to the varcode that is used.
  24.  
  25.     ALLOW_GROW -    This option creates a WDEF that supports a grow box. This
  26.                     grow box behaves exactly like that of a standard document
  27.                     window. This addition to the code was provided to me by
  28.                     Jim Petrick.
  29.     
  30.     ALLOW_ZOOM -    This option creates a windoid that supports a zoombox.
  31.                     To add the zoombox to a windoid, add zoomDocProc to the
  32.                     procID when creating the window. 
  33.                     
  34.                     The application is responsible for setting the user state 
  35.                     and standard state Rects of the window for zooming. (When 
  36.                     a new window is created, both of these are initialized to 
  37.                     the bounds of the window. See the README for more 
  38.                     information).
  39.  
  40.     SMALL_GROW -    This option will cause the grow box to be drawn smaller
  41.                     than the standard size.
  42.  
  43.     STAYPUT_ZOOM -    This option will cause both the user and standard Rects to
  44.                     be changed together, causing the zoomed in and out state
  45.                     to have the same topLeft at all times. If this is not set,
  46.                     the standard and user states have their own 'memories'.
  47.                     (Note: this behavior is not fully tested.)
  48.  
  49.     MFI_ZOOM -        This will cause the WDEF to handle the zoom box in the way
  50.                     expected by MicroFrontier applications (the same way as
  51.                     version 2.2). That is, the other state that is used is one
  52.                     which has a title bar with a small area (in which the host
  53.                     program displays a label for the windoid).
  54.                     
  55.     MACAPP_STYLE -    This determines if the varcodes that are supported are
  56.                     the one's I consider 'normal' or the ones MacApp's
  57.                     windoid WDEF knows about. Note, however, that this code
  58.                     only supports the 'smaller', title-less version that
  59.                     is available in MacApp's.
  60.  
  61.     THINK_STYLE -    This creates a version of the WDEF that is totally
  62.                     compatible with the varcodes used in the windoid WDEF 
  63.                     included with the THINK environments. 
  64.                     
  65.                     Two things are done: varcode 0 gives a normal titlebar, 
  66.                     varcode 2 gives a titlebar down the left side, and other 
  67.                     varcodes (i.e. 1,3,4,5,6,7) give no titlebar at all. 
  68.                     (Note that in my version, a zoom box may also be used 
  69.                     with this style.) Also, for the THINK style, ALWAYS_HILITE 
  70.                     is also set, as this is how theirs works.
  71.  
  72.     ALWAYS_HILITE -    This will cause a windoid to be created that will always
  73.                     draw its title bar with gadgets and all. Normally, the
  74.                     windoid will draw the titlebar and frame in gray and
  75.                     empty when the window is not hilighted (like normal
  76.                     windows). Some programs, however, don't keep their
  77.                     windoids properly hilighted, so this will make them 
  78.                     appear to always be active.
  79.  
  80.     VERS_2_2_COMPATIBLE - This creates a version of the WDEF that is 
  81.                     functionally compatible with the version 2.2 windoid that
  82.                     I released. The only issue involved is the way the zooming
  83.                     is handled.
  84.  
  85.     THICK_TITLEBAR - Defining this will cause the titlebar of the windoid to
  86.                     be a little taller and include tinges along the outside
  87.                     that match those of document windows. 
  88.                     
  89.                     This is similar to Adobe's recent windoids, and also 
  90.                     similar to (but better than in my opinion) the floating 
  91.                     windows put up by Casper on the AV Macs. 
  92.                     
  93.                     This option works especially well if the window has a 
  94.                     grow box (the overall appearance of the windoid is better) 
  95.                     or if title strings are being shown, as descenders are 
  96.                     cut off with the thinner titlebar.
  97.  
  98.     TITLE_STRING -    Due to popular request and several commercial applications
  99.                     with titles in their floaters, I have implemented this
  100.                     option. When enabled, the windoid's title will appear
  101.                     centered in the titlebar. 
  102.                     
  103.                     Currently, this feature does not look at the script and 
  104.                     change the size of the titlebar as is recommended for 
  105.                     regions with an application font that doesn't work at 
  106.                     9 points. 
  107.                     
  108.                     Now, a note: I personally don't like the title showing in 
  109.                     the titlebar of a floater, since it makes it look more 
  110.                     like a document window. If you like them, though, the ones 
  111.                     I have implemented take everything into account.
  112.  
  113.     SYS7_OR_LATER - If this flag is set, a version of the WDEF that doesn't
  114.                     support the System 6 coloring will be compiled. Note that
  115.                     this version may crash on systems earlier than 7.0, so 
  116.                     your application should make sure to check for System 7
  117.                     or later.
  118.                     
  119.     USE_GESTALT -    Define this if you want to use Gestalt to determine the
  120.                     System and QuickDraw versions. Otherwise, SysEnvirons is
  121.                     used. (NOTE: using Gestalt in MPW will cause additional
  122.                     glue code to be attached to the WDEF resource, making it
  123.                     larger.)  With SYS7_OR_LATER, this is automatically
  124.                     defined.
  125.  
  126.     DONT_ALIGN_ZOOM - Prevents the zoom box from forcing itself from being
  127.                     aligned with the titlebar pattern so that it appears
  128.                     aligned the same as the close box (i.e. it would be an
  129.                     extra pixel from the edge of the window).
  130.  
  131.     UNIV_HEADERS -    Define this if you are compiling the WDEF with Universal
  132.                     headers (the only change made is that if you are using
  133.                     them, the ProcPtr for the DeviceLoop drawing routines
  134.                     get created with UniversalProcPtrs).
  135.  
  136.     NOT_PBOOK_AWARE - If this is NOT defined, the WDEF will act like the WDEF 
  137.                     that is included in the PowerBook enabler. That is, when 
  138.                     the window is on the main screen of a PowerBook with a 
  139.                     passive matrix display, the titlebar will always be drawn 
  140.                     in black and white (to avoid shimmering).  If it is defined,
  141.                     PowerBook passive displays are handled like any other 
  142.                     display.
  143.  
  144. ------------------------------------------------------------------------------*/
  145.  
  146. #define THICK_TITLEBAR
  147. // #define TITLE_STRING
  148.  
  149. #define ALLOW_ZOOM
  150. #define ALLOW_VERT
  151.  
  152. // #define ALLOW_GROW
  153. // #define SMALL_GROW
  154.  
  155. // #define SYS7_OR_LATER
  156.  
  157. // #define UNIV_HEADERS
  158. #define VERS_2_2_COMPATIBLE
  159.  
  160. // *****************************************************************************
  161. //    Combinations
  162. //        These should pretty much remain untouched
  163. // -----------------------------------------------------------------------------
  164.  
  165. #ifdef VERS_2_2_COMPATIBLE
  166.     #ifndef MFI_ZOOM
  167.     #define MFI_ZOOM
  168.     #endif
  169.     
  170.     #ifndef STAYPUT_ZOOM
  171.     #define STAYPUT_ZOOM
  172.     #endif
  173. #endif
  174.  
  175. // -----------------------------------------------------------------------------
  176.  
  177. #ifdef THINK_STYLE
  178.     #ifndef ALLOW_VERT
  179.     #define ALLOW_VERT
  180.     #endif
  181.  
  182.     #ifndef ALWAYS_HILITE
  183.     #define ALWAYS_HILITE
  184.     #endif
  185.  
  186.     #ifdef MACAPP_STYLE
  187.     #undef MACAPP_STYLE
  188.     #endif
  189. #endif
  190.  
  191. // -----------------------------------------------------------------------------
  192.  
  193. #ifdef MACAPP_STYLE
  194.     #ifdef ALLOW_VERT
  195.     #undef ALLOW_VERT
  196.     #endif
  197.  
  198.     #ifdef ALWAYS_HILITE
  199.     #undef ALWAYS_HILITE
  200.     #endif
  201.  
  202.     #ifndef ALLOW_GROW
  203.     #define ALLOW_GROW
  204.     #endif
  205. #endif
  206.  
  207. // -----------------------------------------------------------------------------
  208.  
  209. #ifdef SYS7_OR_LATER
  210.     #ifndef USE_GESTALT
  211.     #define USE_GESTALT
  212.     #endif
  213. #endif
  214.  
  215. // *****************************************************************************
  216. //    System version define for the Apple Interfaces
  217. // -----------------------------------------------------------------------------
  218.  
  219. #ifdef SYS7_OR_LATER
  220.     #define SystemSevenOrLater 1    
  221. #else
  222.     #define SystemSixOrLater 1        
  223. #endif
  224.  
  225.     // This is used so that we can cut down on the code size in MPW. If 
  226.     // support for earlier systems is important, get rid of this. 
  227.     // Note: for this define to work under THINK C, MacHeaders cannot be used.
  228.  
  229. // *****************************************************************************
  230. #endif